package com.example.basic.web.controller.newlyManage;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.basic.core.result.Result;
import com.example.basic.core.result.ResultGenerator;
import com.example.basic.web.model.newly.SysFlowTask;
import com.example.basic.web.model.newly.SysPdaFlow;
import com.example.basic.web.response.IndexTaskResponse;
import com.example.basic.web.response.SysFlowResponse;
import com.example.basic.web.service.newly.ISysFlowTaskService;
import com.example.basic.web.service.newlyManage.ISysFlowManageService;
import com.example.basic.web.service.newlyManage.ISysTaskManageService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 流程管理
 */
@RestController
@RequestMapping("/api/v1/byg/flowManage")
public class SysFlowManageController {

    @Autowired
    private ISysFlowManageService sysFlowManageService;

    @PostMapping("/list")
    public Result<IPage<SysFlowResponse>> list(
            @ApiParam(name = "status", value = "设备状态 0未完成 1已完成") Integer status,
            @ApiParam(name = "page", value = "页数，list分页的第几页") @RequestParam(defaultValue = "0") Integer page,
            @ApiParam(name = "size", value = "条数，list分页的每页条数") @RequestParam(defaultValue = "0") Integer size) {
        Page<SysPdaFlow> queryPage = new Page<>(page, size);
        return ResultGenerator.genSuccessResult(sysFlowManageService.queryList(queryPage,status));
    }

}
